import React from "react";
import store from "../store";
import { setMagAction } from "../store/actionCreators/newsAction";
const Index = () => {
  const data = store.getState().news;
  // 修改内容
  const setMsg = () => {
    store.dispatch(setMagAction("新闻".repeat(3)));
  };
  return (
    <div>
      <h3>我是新闻</h3>
      <p>
        {data.msg}
        {data.day}
      </p>
      <button onClick={setMsg}>修改内容</button>
    </div>
  );
};

export default Index;
